package com.dongdongshop.api;

import com.dongdongshop.api.fallback.GoodsServiceApiFallback;
import com.dongdongshop.data.Result;
import com.dongdongshop.dto.ItemDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "dongdongshop-goods-service",fallback = GoodsServiceApiFallback.class)
public interface GoodsServiceApi {
    @GetMapping("/goods/getItemById")
     Result<ItemDTO> getItemById(@RequestParam Long itemId);

    @PostMapping("/item/subStockCount")
    Result subStockCount(@RequestBody List<ItemDTO> itemDTOList);
}
